package com.yowasa.xiuxian.engine.hone.mental;


import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Mental;
import com.yowasa.xiuxian.constant.XiuxianConstants;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;

import java.util.List;

@Mental(name = "托体同山诀")
public class TuoTiTongShanJue implements MentalInterface {


    @Override
    public ElementEnum getElement() {
        return ElementEnum.SOIL;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getElement().get("土") < XiuxianConstants.DEFAULT_ELEMENT_ACTIVITY) {
            throw new HandlerException("修习托体同山诀必须具有土灵根");
        }
    }

    @Override
    public String limitDesc() {
        return "具有土灵根";
    }

    @Override
    public String desc() {
        return "土属性心法,特点是能大幅提高修习者的生命力和物理防御能力,一定程度上提高术法防御力";
    }

    @Override
    public List<String> bsList() {
        return Lists.newArrayList("浊之躯","万钧甲");
    }


    @Override
    public String breakUp(UserBO user) {
        UserBattle upBattle = getBaseUp(user);
        upBattle.setHp((int)((upBattle.getHp()+20) * 1.5));
        upBattle.setChp(upBattle.getHp());
        upBattle.setDef((int)(upBattle.getDef() * 2));
        upBattle.setRes((int)((upBattle.getRes()+5) * 1.5));
        upBattle.setImm((int)(upBattle.getImm() * 1.5));
        buildNewUpBattle(user, upBattle);
        return upBattle.getUpDesc();
    }
    @Override
    public List<String> specialList() {
        return Lists.newArrayList("碧玉护体");
    }


}
